import request from "@/utils/requistApi.js";


// 更新用户名
export function setUserName(data) {
    return request({
        url: "/dpl/v2/user/profile/username",
        method: "put",
        data: data,
    });
}

// 获取头像列表
export function getAvatarList() {
    return request({
        url: `/dpl/v2/user/avatars`,
        method: "get",
    });
}

// 更新头像
export function setAvatar(data) {
    return request({
        url: "/dpl/v2/user/avatars",
        method: "put",
        data: data,
    });
}

// 更换手机号
export function setPhone(data) {
    return request({
        url: "/dpl/v2/user/bind/phone",
        method: "put",
        data: data,
    });
}

// 更换用户邮箱
export function setEmail(data) {
    return request({
        url: "/dpl/v2/user/bind/email",
        method: "put",
        data: data,
    });
}

//设置和修改密码  ×
export function setPassword(data) {
    return request({
        url: "/dpl/v2/user/pwd",
        method: "put",
        data: data,
    });
}

// 绑定微信   √
export function bindWx(data) {
    return request({
        url: "/dpl/v2/user/bind/wechat",
        method: "post",
        data: data,
    });
}

//解绑微信   √
export function unbindWx(data) {
    return request({
        url: "/dpl/v2/user/bind/wechat",
        method: "delete",
        data: data,
    });
}

// 注销用户
export function logoffAccount(data) {
    return request({
        url: "/dpl/v2/user/profile",
        method: "delete",
        data: data,
    });
}
 
// 退出登录
export function logoutAccount() {
    return request({
        url: "/dpl/v2/user/logout",
        method: "get",
    });
}